% Display app res, phase & asso errors
% with impedance tensor & erros as input
% tested 9/11/02 -ok
% changed the error bar plotting 12/11/02
% known bug - if (Rhxy - RhxyErr/2) <0, log plot will propmt an error message
% latest date 13.10.2002

function[] = disptf(tf1,ProcDef,c,comp)

frq=ProcDef.TLFreq1;
nfrq = length(frq);
tf = tf1(:,comp);
tferr = tf1(:,comp+4);

%--------------------------------------------------------------
T = 1./frq;

mnx=ceil(log10(max(T)))+1;
mux=floor(log10(min(T)))-1;
mny=ceil(log10(max(abs(tf))))+1;
muy=floor(log10(min(abs(tf))))-1;


   plot(log10(T'),log10(abs(tf)),c);
for i = 1:nfrq,
   tt = log10(abs(tf(i)));
   kk = log10(abs(tf(i))+tferr(i)/2);
   vv = 2*tt-kk;
   h=line(log10([T(i) T(i)]),[kk vv]);
   set(h,'color',c);
end;
axis([mux mnx muy mny]);
grid on;

hold on;
